import axios from '../service/http.service.js'
import api from '../config/index.js'
import local from '../service/local.service.js'
require('../mock.js')

const apiBase = api.ApiBaseUrl

export default {
  getHomeData () {
		return axios.get(`${apiBase}mall/home?channel=1`)
  },
  test(){
    return axios.get('msg')
  },
  //获取验证码
  getVerify(){
    return axios.get('/rest/v1/app1/user/sessions/verify-code/')
  },
  //登录
  login(options){
    return axios.post('/rest/v1/app1/user/sessions/login_req/', options)
  },
  //通讯录
  searchPeople(options){
    let sessionid = local.get('session_id') || ''
    return axios.post(`/rest/v1/app1/user/sessions/${sessionid}/departments/department_ids/search/`, options)
  },
  //订阅部门
  searchDepartments(options){
    let sessionid = local.get('session_id') || ''
    return axios.post(`/rest/v1/app1/user/sessions/${sessionid}/departments/department_ids/`, options)
  },
  searchChildren(options){
    let sessionid = local.get('session_id') || ''
    return axios.post(`/rest/v1/app1/user/sessions/${sessionid}/departments/children_ids/`, options)
  },
  //获取会议列表数据
  getMeetingList(options){
    let sessionid = local.get('session_id') || ''
    return axios.post(`/rest/v1/app1/user/sessions/${sessionid}/schedules/schedule_ids/search/`, options)
  }
}